home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
(A)TA
/
(A)TAL.ADF
/
Basic_Progs
/
Star_Trek
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1986-11-06
|
22KB
|
602 lines
'Super Star Trek' May 16,1978, adapted to `AMY' Dec 16, 1987
' by Bill Elliott. Box 377,
' Port Dover Ontario, N0A 1N0
'Phone (519) 583-2525
GOSUB setscreen:GOTO titlestrip
'Colour combinations courtesy John Bos (BAUG):
setscreen:
rgb 0,9,9,9 'paper
rgb 1,0,0,0 'pen
rgb 2,13,0,0 'field
rgb 3,15,15,0 'highlight
SUB rgb(n%,r%,g%,b%) STATIC
PALETTE n%,r%/16,g%/16,b%/16
END SUB
PRINT :PRINT :PRINT :PRINT :PRINT :PRINT :PRINT :PRINT :PRINT :PRINT :PRINT
DIM g(8,8),c(9,2),k(3,3),n(3),z(8,8),d(8)
titlestrip:RESTORE:GOSUB speech
PRINT " ,------*------,"
PRINT " ,-------------- `--- --------'"
PRINT " `-------- ---' / / "
PRINT " ,---' `------- / /--, "
PRINT " `-------------------' "
PRINT " The USS Enterprise---NCC-1701"
PRINT :PRINT :PRINT :PRINT :PRINT :GOSUB sayone
RANDOMIZE TIMER
z$ = " "
t = INT (RND*20+20)*100:t0 = t:t9 = 25+INT (RND*10):d0 = 0:e = 3000:e0 = e
p=10:p0=p:s9=200:s=0:b9=0:k9=0:x$="":x0$=" is "
470 DEF FN d(i) = SQR((k(i,1)-s1)^2+(k(i.2)-s2)^2)
475 DEF FN r(i) = INT(RND*7.98+ 1.01)
' Initialize Enterprise's position
490 q1 = FNr(1): q2 = FNr(1): s1 = FNr(1): s2 = FNr(1)
FOR i = 1 TO 9: c(i,1) = 0: c(i,2) = 0 :NEXT i
c(3,1) = -1: c(2,1) = -1: c(4,1) = -1: c(4,2) = -1: c(5,2)= -1:c(6,2)= -1
600 c(1,2) = 1: c(2,2) = 1: c(6,1) = 1: c(7,1) =1: c(8,1) =1: c(8,2) =1: c(9,2) =1
670 FOR i = 1 TO 8: d(i) =0: NEXT i
a1$ ="navsrslrsphatorshedamcomxxx"
' Set up what exists in the galaxy...
' k3 = # Klingons b3 = # Starbases s3 = Stars
820 FOR i = 1 TO 8: FOR j = 1 TO 8: k3 = 0: z(i,j) = 0:r1= RND
IF r1 >0.98 THEN k3 = 3: k9 = k9+ 3: GOTO 980
IF r1 >0.95 THEN k3 = 2: k9 = k9 + 2: GOTO 980
IF r1 >0.8 THEN k3 = 1: k9 = k9+ 1
980 b3 = 0: IF RND>0.96 THEN b3 = 1: b9 =b9 +1
g(i,j) = k3*100+b3*10+FNr(1):NEXT j:NEXT i:IF k9>t9 THEN t9=k9+1
IF b9<>0 THEN 1200
IF g(q1,q2)<200 THEN g(q1,q2) = g(q1,q2) + 100: k9 = k9 + 1
b9 = 1: g(q1,q2)= g(q1,q2)+ 10: q1 =FNr(1):q2 = FNr(1)
1200 k7= k9:IF b9<> 1 THEN x$ = "s": x0$= " are"
PRINT " Your orders are as follows:"
PRINT " Destroy the";k9;"Klingon warships which have invaded the "
PRINT " Galaxy before they can attack Federation Headquarters"
PRINT " on Stardate";t0+t9;" This gives you";t9;"days. There";x0$
PRINT " ";b9;"Starbase";x$;" in the Galaxy for resupplying your ship."
PRINT
1299 INPUT " Hit an `r' and then RETURN when ready to accept command.";r$
1300 IF r$<>"r" THEN 1299
'Here any time new quadrant entered
1320 z4= q1: z5= q2: k3= 0: b3= 0: s3= 0: g5= 0: d4= 0.5* RND: z(q1,q2)= g(q1,q2)
IF q1< 1 OR q1>8 OR q2< 1 OR q2> 8 THEN 1600
GOSUB 9030:PRINT :IF t0<> t THEN 1490
PRINT " Your mission begins with your Starship located"
PRINT " in the Galactic Quadrant, `";g2$;"'.": GOTO 1500
1490 PRINT " Now entering ";g2$;" Quadrant. . ."
1500 PRINT : k3= INT(g(q1,q2)*0.01): b3= INT(g(q1,q2)*0.1)-10*k3
s3= g(q1,q2)- 100*k3 - 10*b3: IF k3 = 0 THEN 1590
PRINT " Combat area Condition Red": IF s>200 THEN 1590
PRINT " Shields dangerously low!!!"
1590 FOR i = 1 TO 3 : k(i,1)=0: k(i,2)= 0: NEXT i
1600 FOR i = 1 TO 3: k(i,3)=0:NEXT i:q$=z$+z$+z$+z$+z$+z$+z$+ LEFT$(z$,17)
'Position of Enterprise in Quadrant then place K3 Klingons in
'Quadrant & B3 Starbases and S3 stars elsewhere.
1680 a$= "<*>":z1=s1:z2=s2: GOSUB 8670: IF k3<1 THEN 1820
1720 FOR i = 1 TO k3: GOSUB 8590: a$ = "+K+": z1=r1: z2=r2
1780 GOSUB 8670: k(i,1)=r1: k(i,2)=r2: k(i,3)=s9*(0.5+ RND):NEXT i
1820 IF b3 < 1 THEN 1910
1880 GOSUB 8590: a$ = ">!<": z1= r1: b4= r1: z2= r2:b5= r2: GOSUB 8670
1910 FOR i = 1 TO s3: GOSUB 8590: a$= " * ": z1= r1: z2= r2: GOSUB 8670: NEXT i
1980 GOSUB 6430
1990 IF s + e>10 THEN IF e>10 OR d(7)= 0 THEN 2060
PRINT :PRINT " ** Fatal Error ** You've just stranded your ship in"
PRINT " Space:?" You have insufficient maneuvering energy,";
PRINT " and Shield control":PRINT " Presently incapable of cross";
PRINT "-circuiting to Engine Room!!": GOTO 6220
2060 INPUT " Command";a$
FOR i = 1 TO 9: IF LEFT$ (a$,3)<> MID$(a1$,3*i-2,3) THEN 2160
ON i GOTO 2300,1980,4000,4260,4700,5530,5690,7290,6270
2160 NEXT i:PRINT " Enter one of the following:"
PRINT " nav...to set course
PRINT " srs...for short range sensor scan 3
PRINT " lrs...for long range sensor scan 4 | 2
PRINT " pha...to fire phasers 5--|--1
PRINT " tor...to fire photon torpedoes 6 | 8
PRINT " she...to raise or lower shields 7
PRINT " dam...for damage control reports
PRINT " com...to call on library-computer
PRINT " xxx...to resign your command":GOTO 1990
'Course Control begins here...
2300 INPUT " Course (0-9)";c1:IF c1=9 THEN c1=1
IF c1 >=1 AND c1<9 THEN 2350
WINDOW OUTPUT 1: PRINT " Lt. Sulu reports, `Incorrect course data Sir!!": GOTO 1990
2350 WINDOW OUTPUT 1:x$= "8": IF d(1)<0 THEN x$= "0.2"
2360 PRINT " Warp Factor (0-";x$;")";:INPUT w1:IF d(1)<0 AND w1>0.2 THEN 2470
IF w1 >0 AND w1 <=8 THEN 2490
IF w1 = 0 THEN 1990
PRINT " Chief Engineer Scott reports `The engines won't take";
PRINT "Warp ";w1;'": GOTO 1990
2470 PRINT " Warp engines are damaged. Maximum speed = Warp 0.2":GOTO 1990
2490 n= INT(w1*8+0.5): IF e-n>= 0 THEN 2590
PRINT " Engineering reports `Insufficient Energy available"
PRINT " for maneuvering at Warp";w1;"!'"
IF s <n- e OR d(7)< 0 THEN 1990
PRINT " Deflector Control Room acknowledges";s;"units of Energy"
PRINT " presently deployed to Shields."
GOTO 1990
'Klingons move/fire on moving Starship. . .
2590 FOR i = 1 TO k3: IF k(i,3) = 0 THEN 2700
a$= " ": z1= k(i,1): z2= k(i,2): GOSUB 8670:GOSUB 8590
2660 k(i,1)=z1:k(i,2)=z2:a$="+K+": GOSUB 8670
2700 NEXT i: GOSUB 6000: d1= 0: d6= w1: IF w1 >= 1 THEN d6 = 1
FOR i= 1 TO 8: IF d(i)>=0 THEN 2880
d(i) = d(i) +d6: IF d(i)> -0.1 AND d(i) <0 THEN d(1) = -0.1:GOTO 2880
IF d(i) <0 THEN 2880
IF d1 <> 1 THEN d1 = 1: PRINT " Damage Control Report: ";
PRINT TAB(8);:r1=i:GOSUB 8790:PRINT g2$;" Repair completed."
2880 NEXT i: IF RND>0.2 THEN 3070
r1 = FNr(1): IF RND>= 0.6 THEN 3000
d(r1) = d(r1)-(RND*5+1): PRINT " Damage Control Report: ";
GOSUB 8790:PRINT g2$;" Damaged":PRINT :GOTO 3070
3000 d(r1)=d(r1)+RND*3+1:PRINT " Damage Control Report: ";
GOSUB 8790: PRINT g2$;" State of repair improved":PRINT
' Begin moving Starship
3070 a$= " ": z1=INT(s1):z2=INT(s2):GOSUB 8670
3110 x1=c(c1,1)+(c(c1+1,1)-c(c1,1))*(c1-INT(c1)):x=s1:y=s2
3140 x2=c(c1,2)+(c(c1+1,2)-c(c1,2))*(c1-INT(c1)):q4=q1:q5=q2
3170 FOR i = 1 TO n:s1=s1+x1: s2=s2+x2:IF s1<1 OR s1>=9 OR s2<1 OR s2>=9 THEN 3500
3240 s8 = INT(s1)*24 + INT (s2)*3-26: IF MID$(q$,s8,2)= " " THEN 3360
3320 s1 = INT(s1-x1): s2 = INT(s2-x2):PRINT " Warp Engines shut down at ";
PRINT " Sector";s1;",";s2;" due to bad Navigation.":GOTO 3370
3360 NEXT i: s1 = INT(s1):s2= INT (s2)
3370 a$= "<*>": z1=INT(s1): z2=INT(s2): GOSUB 8670:GOSUB 3910:t8=1
3430 IF w1 <1 THEN t8= 0.1*INT (10*w1)
t=t+t8: IF t> t0+t9 THEN 6220
'See if docked then get command
GOTO 1980
' Exceded Quadrant Limits
3500 x = 8*q1+x+n*x1: y= 8*q2+y+n*x2: q1= INT(x/8):q2=INT(y/8): s1= INT(x-q1*8)
s2 = INT(y-q2*8): IF s1=0 THEN q1=q1-1: s1=8
IF s2 = 0 THEN q2=q2-1: s2=8
x5=0:IF q1<1 THEN x5=1: q1=1: s1=1
IF q1>8 THEN x5=1:q1=8:s1=8
IF q2<1 THEN x5=1:q2=1:s2=1
IF q2>8 THEN x5=1:q2=8:s2=8
IF x5=0 THEN 3860
PRINT " Lt. Uhura reports message from Starfleet Command:"
PRINT " `Permission to attempt crossing of Galactic Perimeter
PRINT " is hereby * denied *. Shut down your engines.'"
PRINT " Chief Engineer Scott reports `Warp Engines shut down'"
PRINT " at Sector";s1;",";s2;"of Quadrant";q1;",";q2;".'"
IF t>t0+t9 THEN 6220
3860 IF 8*q1+q2= 8*q4+q5 THEN 3370
t=t+1: GOSUB 3910:GOTO 1320
' Maneuvre energy s/r **
3910 e=e-n-10: IF e>= 0 THEN RETURN
PRINT " Shield Control supplies energy to complete the maneuvre."
s=s+e: e=0: IF s<=0 THEN s=0
RETURN
' Long Range Sensor Scan Code
4000 IF d(3) <0 THEN PRINT " Long Range Sensors are inoperable.": GOTO 1990
PRINT " Long Range Scan for Quadrant";q1;",";q2
o1$ ="-------------------":PRINT o1$
FOR i=q1-1 TO q1+1:n(1)=-1:n(2)=-2:n(3)=-3: FOR j= q2-1 TO q2+1
IF i>0 AND i<9 AND j>0 AND j<9 THEN n(j-q2+2)= g(i,j): z(i,j) = g(i,j)
NEXT j: FOR l = 1 TO 3:PRINT ": ";:IF n(l)<0 THEN PRINT "*** ";:GOTO 4230
PRINT RIGHT$(STR$(n(l)+1000),3);" ";
4230 NEXT l: PRINT ":":PRINT o1$:NEXT i:GOTO 1990
' Phaser Control Code begins here
4260 IF d(4) <0 THEN PRINT " Phasers Inoperative": GOTO 1990
IF k3 >0 THEN 4330
4270 PRINT " Science Officer Spock reports `Sensors show no enemy ships"
PRINT " in this Quadrant'":GOTO 1990
4330 IF d(8)<0 THEN PRINT " Computer failure hampers accuracy."
4350 PRINT " Phasers locked on target; ";
4360 PRINT " Energy available =";e;"units"
INPUT"Number of units to fire";x: IF x<=0 THEN 1990
IF e-x <0 THEN 4360
e = e-x: IF d(7)<0 THEN x=x*RND
4450 h1 =INT(x/k3): FOR i = 1 TO 3: IF k(i,3)<=0 THEN 4670
4480 h = INT((h1/RND(0))*(RND(1)+2)):IF h>0.15*k(i,3) THEN 4530
PRINT " Sensors show no damage to enemy at ";k(i,1);",";k(i,2): GOTO 4670
4530 k(i,3)=k(i,3)-h:PRINT h;" Unit hit on Klingon at Sector";k(i,1);",";k(i,2)
IF k(1,3)<=0 THEN PRINT "*** Klingon Destroyed ***":GOTO 4580
PRINT " (Sensors show";k(i,3);"Units remaining)":GOTO 4670
4580 k3=k3-1: k9=k9-1: z1=k(i,1): z2=k(i,2): a$=" ": GOSUB 8670
k(i,3)=0: g(q1,q2)=g(q1,q2)-100: z(q1,q2)=g(q1,q2): IF k9<=0 THEN 6370
4670 NEXT i:GOSUB 6000: GOTO 1990
' Photon Torpedo Code begins here...
4700 IF p<=0 THEN PRINT " All Photon Torpedoes expended": GOTO 1990
IF d(5)<0 THEN PRINT " Photon tubes are not operational": GOTO 1990
4760 INPUT " Photon torpedo course (1-9)";c1: IF c1 = 9 THEN c1=1
IF c1 >=1 AND c1 <=9 THEN 4850
PRINT " Ensign Chekov reports, `Incorrect course data Sir!'"
GOTO 1990
4850 x1= c(c1,1)+(c(c1+1,1)-c(c1,1))*(c1-INT(c1)): e=e-2:p=p-1
4860 x2= c(c1,2)+(c(c1+1,2)-c(c1,2))*(c1-INT(c1)): x=s1: y=s2
PRINT " Torpedo track:"
4920 x=x+x1: y=y+x2: x3 = INT(x+0.5): y3= INT(y+0.5)
IF x3<1 OR x3>8 OR y3<1 OR y3>8 THEN 5490
5000 PRINT " ";x3",";y3: a$=" ": z1=x: z2=y: GOSUB 8830
IF z3<>0 THEN 4920
a$= "+K+": z1= x: z2= y: GOSUB 8830: IF z3= 0 THEN 5210
PRINT " *** Klingon Destroyed ***":k3= k3-1: k9=k9-1: IF k9 <=0 THEN 6370
FOR i = 1 TO 3: IF x3= k(i,1) AND y3 = k(i,2) THEN 5190
NEXT i: i=3
5190 k(i,3)=0: GOTO 5430
5210 a$=" * ": z1=x: z2=y: GOSUB 8830: IF z3=0 THEN 5280
PRINT " Star at";x3;",";y3;"absorbed Torpedo energy." :GOSUB 6000: GOTO 1990
5280 a$= ">!<": z1=x: z2=y: GOSUB 8830:IF z3 = 0 THEN 4760
5330 PRINT " *** Starbase Destroyed ***": b3=b3-1: b9=b9-1
IF b9>0 OR k9>t-t0-t9 THEN 5400
GOSUB saysix:PRINT " That does it Captain!! You are hereby relieved of Command"
PRINT "and sentenced to 99 Stardates at Hard Labour on Cygnus 12!!"
GOTO 6270
5400 GOSUB sayseven: PRINT " Starfleet Command reviewing your record to consider"
PRINT " Court Martial!": d0=0
5430 z1=x: z2=y: a$=" ": GOSUB 8670
g(q1,q2)= k3*100+b3*10+s3: z(q1,q2)=g(q1,q2): GOSUB 6000: GOTO 1990
5490 PRINT " Torpedo missed": GOSUB 6000: GOTO 1990
'Shield Control
5530 IF d(7)<0 THEN PRINT " Shield Control Inoperable": GOTO 1990
PRINT " Energy available =";e+s;: INPUT "Number of Units to Shields";x
IF x <=0 OR s=x THEN PRINT " <Shields unchanged>": GOTO 1990
IF x <=e THEN 5630
PRINT " Shield Control Reports ` This is not the Federation Treasury.'"
PRINT " <Shields Unchanged>": GOTO 1990
5630 e=e+s-x: s=x: PRINT " Deflector Control Room Report:"
PRINT " `Shields now at";INT(s);"units per your command.'": GOTO 1990
'Damage Control
5690 IF d(6) >=0 THEN 5910
5700 PRINT " Damage Control Report not available": IF d0=0 THEN 1990
5720 d3=0: FOR i = 1 TO 8: IF d(i) <0 THEN d3=d3+0.1
NEXT i: IF d3=0 THEN 1990
PRINT : d3=d3+d4: IF d3>=1 THEN d3=0.9
5810 PRINT " Technicians standing by to effect repairs to your ship;"
PRINT " Estimated time to repair:";0.01*INT(100 *d3);"Stardates"
INPUT " Will you authorize the repair order (y/n)";a$
IF a$ <> "y" THEN 1990
FOR i = 1 TO 8: IF d(i)<0 THEN d(i) = 0
NEXT i: t = t+d3+0.1
5910 PRINT :PRINT " Device State of Repair": FOR r1= 1 TO 8
GOSUB 8790: PRINT g2$;LEFT$(z$,25-LEN(g2$)); INT(d(r1)*100)*0.01
NEXT r1: PRINT : IF d0<>0 THEN 5720
GOTO 1990
' Klingons Shooting
6000 IF k3<=0 THEN RETURN
IF d0<>0 THEN PRINT " Starbase Shields protect the Enterprise": RETURN
FOR i = 1 TO 3: IF k(i,3)<=0 THEN 6200
6060 h=INT((k(i,3)/RND(1))*(0.02+RND(1))): s=s-h: k(i,3)=k(i,3)/(3+RND(0))
PRINT h;"Unit hit on Enterprise from Sector";k(i,1);",";k(i,2)
IF s<=0 THEN 6240
PRINT " <Shields down to";s;"units>": IF h<20 THEN 6200
IF RND >0.6 OR h/s <=0.02 THEN 6200
r1 = FNr(1): d(r1)=d(r1)-h/s-0.5*RND: GOSUB 8790
PRINT " Damage control reports `";g2$;" damaged by the hit'"
6200 NEXT i: RETURN
' End of Game
6220 PRINT " It is Stardate";t: GOTO 6270
6240 PRINT :GOSUB sayfive: PRINT " The Enterprise has been destroyed. The Federation ";
PRINT " will be conquered": GOTO 6220
6270 PRINT " There were:";k9;"Klingon Battle Cruisers left at"
PRINT " the end of your mission."
6290 PRINT :PRINT
GOSUB saytwo
PRINT " The Federation is in need of another Starship Commander"
PRINT " for a similar mission -- If there is a volunteer,"
INPUT" let him step forward and enter `aye'";a$: IF a$ = "aye" THEN GOTO titlestrip
6360 END
6370 GOSUB saythree:PRINT " Congratulations, Captain! The last Klingon Battle Cruiser"
PRINT " menacing the Federation has been destroyed.":PRINT
PRINT " Your efficiency rating is";1000*(k7/(t-t0))^2: GOTO 6290
'Short Range Sensor Scan & Startup Subroutine
6430 FOR i=s1-1 TO s1+1: FOR j=s2-1 TO s2+1
6450 IF INT(i+0.5)<1 OR INT(i+0.5)>8 OR INT(j+0.5)<1 OR INT(j+0.5)>8 THEN 6540
6490 a$= ">!<": z1=i: z2=j: GOSUB 8830: IF z3=1 THEN 6580
6540 NEXT j: NEXT i: d0=0: GOTO 6650
6580 d0=1:c$="docked": e=e0: p=p0
6620 PRINT " Shields dropped for docking purposes": s=0: GOTO 6720
6650 IF k3>0 THEN c$="*red*":GOTO 6720
c$= "green": IF fe<e0*0.1 THEN c$ = "yellow"
6720 IF d(2)>=0 THEN 6770
PRINT :PRINT " *** Short Range Sensors Are Out ***":PRINT :RETURN
6770 o1$= "---------------------------------":PRINT o1$: FOR i = 1 TO 8
6820 FOR j=(i-1)*24+1 TO (i-1)*24+22 STEP 3:PRINT " "; MID$(q$,j,3);: NEXT j
6830 ON i GOTO 6850,6900,6960,7020,7070,7120,7180,7240
6850 PRINT " 3 Stardate ";INT(t*10)*0.1:GOTO 7260
6900 PRINT " 4 | 2 Condition ";c$:GOTO 7260
6960 PRINT " 5--|--1 Quadrant ";q1;",";q2:GOTO 7260
7020 PRINT " 6 | 8 Sector ";s1;",";s2: GOTO 7260
7070 PRINT " 7 Photon Torpedoes ";INT(p): GOTO 7260
7120 PRINT " DIR Total Energy ";INT(e+s): GOTO 7260
7180 PRINT " Shields ";INT(s): GOTO 7260
7240 PRINT " Klingons Remaining";INT(k9)
7260 NEXT i :PRINT o1$: RETURN
'Library Computer Code
7290 IF d(8)<0 THEN PRINT " Computer disabled": GOTO 1990
7330 PRINT " Functions available from Library-Computer:"
PRINT " 1 = Cumulative Galactic Record"
PRINT " 2 = Status Report"
PRINT " 3 = Photon Torpedo Data
PRINT " 4 = Starbase Navigation Data
PRINT " 5 = Direction/Distance Calculator
PRINT " 6 = Galaxy `Region Name' Map":PRINT
7340 h8=1:INPUT" Computer active and awaiting command";a :IF a<0 THEN 1990 :a=a+1
7350 ON a GOTO 7544,7900,8070,8500,8150,7400
'Setup to change Cumulative Galactic Record to Galaxy Map
7400 h8=0: g5=1: PRINT " The Galaxy": GOTO 7550
'Cumulative Galactic Record
7540:
7544 PRINT " Computer Record of Galaxy for Quadrant";q1;",";q2
PRINT
7550 PRINT " 1 2 3 4 5 6 7 8
o1$=" ----- ----- ----- ----- ----- ----- ----- -----
PRINT o1$: FOR i = 1 TO 8:PRINT i;: IF h8=0 THEN 7740
FOR j=1 TO 8: PRINT " ";:IF z(i,j)=0 THEN PRINT "***";:GOTO 7720
PRINT RIGHT$(STR$(z(i,j)+1000),3);
7720 NEXT j: GOTO 7850
7740 z4=i: z5=1: GOSUB 9030: j0=INT(15-0.5*LEN(g2$)):PRINT TAB(j0);g2$;
z5=5: GOSUB 9030: j0=INT(39-0.5* LEN(g2$)): PRINT TAB(j0);g2$;
7850 PRINT :PRINT o1$:NEXT i: GOTO 1990 'some pokes left out***
'Status Report
7900 PRINT " Status Report:":x$="": IF k9>1 THEN x$= "s"
PRINT "Klingon";x$;" Left: ";k9
PRINT "Mission must be completed in";0.1*INT((t0+t9-t)*10);"Stardates"
x$="s": IF b9<2 THEN x$ ="": IF b9<1 THEN 8010
PRINT "The Federation is maintaining";b9;"Starbase";x$;" in the Galaxy"
GOTO 5690
GOSUB sayfour
8010 PRINT " Your stupidity has left you on your own in"
PRINT " the Galaxy -- You have no Starbases left!" :GOTO 5690
' Torpedo, Base Navigation, Distance/Direction Calculator...
8050 FNd(i)=INT(FNd(i)*100000)/100000
8070 IF k3<=0 THEN 4270
x$="": IF k3>1 THEN x$="s"
PRINT " From Enterprise to Klingon Battle Cruiser";x$
h8=0:FOR i=1 TO 3: IF k(i,3)<=0 THEN 8480
w1=k(i,1): x=k(i,2)
8120 c1=s1:a=s2: GOTO 8220
8150 PRINT " Direction/Distance Calculator:"
PRINT " You are at Quadrant ";q1;",";q2;" Sector ";s1;",";s2
PRINT "Please enter":INPUT" Initial Coordinates (x,y)";c1,a
INPUT" Final Coordinates (x,y)";w1,x
8220 x=x-a: a=c1-w1: IF x<0 THEN 8350
IF a<0 THEN 8410
IF x>0 THEN 8280
IF a=0 THEN c1=5: GOTO 8290
8280 c1=1
8290 IF ABS(a)<=ABS(x) THEN 8330
8310 PRINT " Direction =";c1+(((ABS(a)-ABS(x))+ABS(a))/ABS(a)):GOTO 8460
8330 PRINT " Direction =";c1+(ABS(a)/ABS(x)): GOTO 8460
8350 IF a>0 THEN c1=3: GOTO 8420
8360 IF x<>0 THEN c1=5: GOTO 8290
8410 c1=7
8420 IF ABS(a) >=ABS(x) THEN 8450
8450 PRINT " Direction =";c1+(((ABS(x)-ABS(a))+ABS(x))/ABS(x)): GOTO 8460
8460 PRINT " Distance =";SQR(x^2+a^2): IF h8=1 THEN 1990
8480 NEXT i: GOTO 1990
8500 IF b3<>0 THEN PRINT " From Enterprise to Starbase:":w1=b4:x=b5: GOTO 8120
PRINT " Mr. Spock reports: `Sensors show no Starbases in this ";
PRINT "Quadrant.": GOTO 1990
'Find Empty Place in Quadrant for Things
8590 r1=FNr(1): r2=FNr(1): a$=" ": z1=r1: z2=r2: GOSUB 8830: IF z3=0 THEN 8590
8600 RETURN
'Insert in String Array for Quadrant
8670 s8=INT(z2-0.5)*3+INT(z1-0.5)*24+1
IF LEN(a$)<>3 THEN PRINT "ERROR": STOP
IF s8=1 THEN q$=a$+RIGHT$(q$,189): RETURN
IF s8=190 THEN q$=LEFT$(q$,189)+a$:RETURN
8700 q$ = LEFT$(q$,s8-1) + a$ + RIGHT$(q$,190-s8):RETURN
'Prints Device Name
8790 ON r1 GOTO 8792,8794,8796,8798,8800,8802,8804,8806
8792 g2$= "Warp Engines": RETURN
8794 g2$= "Short Range Sensors":RETURN
8796 g2$= "Long Range Sensors":RETURN
8798 g2$= "Phaser Control":RETURN
8800 g2$= "Photon Tubes": RETURN
8802 g2$= "Damage Control": RETURN
8804 g2$= "Shield Control": RETURN
8806 g2$= "Library-Computer":RETURN
'String Comparison in Quadrant Array
8830 z1=INT(z1+0.5): z2=INT(z2+0.5): s8=(z2-1)*3+(z1-1)*24+1: z3=0
IF MID$(q$,s8,3)<>a$ THEN RETURN
z3=1:RETURN
'Quadrant name in g2$ from z4,z5 (=q1,q2)
'Call with g5=1 to get region name only
9030 IF z5<=4 THEN ON z4 GOTO 9040,9050,9060,9070,9080,9090,9100,9110
GOTO 9120
9040 g2$ ="Antares":GOTO 9210
9050 g2$ ="Rigel":GOTO 9210
9060 g2$ ="Procyon":GOTO 9210
9070 g2$ ="Vega": GOTO 9210
9080 g2$ ="Canopus": GOTO 9210
9090 g2$ ="Altair" : GOTO 9210
9100 g2$ ="Sagittarius": GOTO 9210
9110 g2$ ="Pollux": GOTO 9210
9120 ON z4 GOTO 9130,9140,9150,9160,9170,9180,9190,9200
9130 g2$="Sirius":GOTO 9210
9140 g2$="Deneb":GOTO 9210
9150 g2$="Capella":GOTO 9210
9160 g2$="Betelgeuse":GOTO 9210
9170 g2$="Aldebaran":GOTO 9210
9180 g2$="Regulus": GOTO 9210
9190 g2$="Arcturus": GOTO 9210
9200 g2$="Spica":GOTO 9210
9210 IF g5<>1 THEN ON z5 GOTO 9230,9240,9250,9260,9230,9240,9250,9260
9220 RETURN
9230 g2$=g2$+" I":RETURN
9240 g2$=g2$+" II":RETURN
9250 g2$=g2$+" III":RETURN
9260 g2$=g2$+" IV":RETURN
speech:
FOR Count = 0 TO 8
READ FemNat% (Count)
NEXT Count
FOR Count = 0 TO 8
READ MaleNat% (Count)
NEXT Count
DATA 185,0,155,1,24000,55,5,0,0
DATA 90,0,165,0,20000,64,5,0,0
FOR Count = 0 TO 9
READ t$(Count)
NEXT Count
DATA "Read your orders carefully."
DATA "The Federation ihz in need of a new Star ship Commander. Ihz anyone interested?"
DATA "If there ihz, let him step forward, and enter eye!"
DATA "Your stewpidity has left you stranded in the Galaxy. You have no Star bases left!"
DATA "Congratulations Kaptin! The last Klingon battle crooser menacing the federation"
DATA "has been dehstroyed."
DATA "The Enterprise has been destroyed. The Federation will be conkered."
DATA "That duz it Kaptin! You are herebuy relieved of your Command"
DATA "and sentenced to nyntee-nine star dates at hard labor on cygnus twelve."
DATA "Starfleet command ihz reviewing your wreckord to consihder Court Marshall."
RETURN
sayone:
SAY TRANSLATE$ (t$(0)) ,MaleNat%
RETURN
saytwo:
SAY TRANSLATE$ (t$(1)), MaleNat%
SAY TRANSLATE$ (t$(2)), MaleNat%
RETURN
saythree:
SAY TRANSLATE$ (t$(4)), MaleNat%
SAY TRANSLATE$ (t$(5)), MaleNat%
RETURN
sayfour:
SAY TRANSLATE$ (t$(3)), FemNat%
RETURN
sayfive:
SAY TRANSLATE$ (t$(6)), FemNat%
RETURN
saysix:
SAY TRANSLATE$ (t$(7)), MaleNat%
SAY TRANSLATE$ (t$(8)), MaleNat%
RETURN
sayseven:
SAY TRANSLATE$ (t$(9)), MaleNat%
RETURN